Skip to content

fix: handle missing user theme_preference on sign in #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Mar 6, 2025

coder/coder#16564 has the Coder server no longer send the theme_preference field in a /api/v2/user response.

The Swift JSONDecoder requires that a missing field be explicitly marked as optional, else the deserialization fails. To make it less likely this happens again, we'll only require id and username be present.
We'll do the same for the other SDK types and only require the minimum fields the app needs be present.

This PR also improves the error message on any decoding error:
Screenshot 2025-03-06 at 1 35 33 pm

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ethanndickson ethanndickson marked this pull request as ready for review March 6, 2025 02:47
@ethanndickson ethanndickson self-assigned this Mar 6, 2025
@ethanndickson ethanndickson force-pushed the ethan/handle-breaking-user-response branch from 404de0d to ff5b5c0 Compare March 6, 2025 02:52
Copy link
Member Author

ethanndickson commented Mar 6, 2025

Merge activity

  • Mar 5, 10:24 PM EST: A user started a stack merge that includes this pull request via Graphite.
  • Mar 5, 10:25 PM EST: A user merged this pull request with Graphite.

@ethanndickson ethanndickson merged commit 2dee620 into main Mar 6, 2025
4 checks passed
@deansheather deansheather deleted the ethan/handle-breaking-user-response branch March 7, 2025 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants